package enum_;

/**
 * 体会enum定义的枚举类
 * 做了简化
 * 小细节，
 *  1. class替换成enum
 *  2. public final static Season SPRING = new Season("春天", "温暖");
 *      ->  SPRING("春天", "温暖")
 *  3. 枚举对象放在类的最前面
 *  4. 枚举对象用逗号','间隔
 */
public class Test02 {
    public static void main(String[] args) {
        System.out.println(Season02.SPRING);
        System.out.println(Season02.SUMMER);
        System.out.println(Season02.AUTUMN);
        System.out.println(Season02.WINTER);
    }
}
enum Season02 {
    SPRING("春天", "温暖"),
    SUMMER("夏天", "炎热"),
    AUTUMN("秋天", "凉爽"),
    WINTER("冬天", "寒冷");

    private String name;
    private String desc;
//    public final static Season SPRING = new Season("春天", "温暖");
//    public final static Season SUMMER = new Season("夏天", "炎热");
//    public final static Season AUTUMN = new Season("秋天", "凉爽");
//    public final static Season WINTER = new Season("冬天", "寒冷");

    private Season02(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "Season{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
